package com.blb.service;

import com.blb.entity.Department;
import com.baomidou.mybatisplus.extension.service.IService;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author HuaHao
 * @since 2019-11-14
 */
public interface IDepartmentService extends IService<Department> {

    /**
     * 根据公司id查询所有部门
     * @return
     */
    List<Department> getAllDepartment(String cId);

    /**
     * 根据pid查询部门
     * @param pid
     * @return
     */
    List<Department> getDepartmentByPid(String pid);


    /**
     * 根据pid查询所有父部门
     * @param pid
     * @return
     */
    List<Department> getDepartmentsByPid(String pid,String cId);

    /**
     * 通过父部门id找到所有子部门
     * @param dId
     * @return
     */
    List<Department> getDepartmentsById(String dId);


    /**
     * 根据id查询部门
     * @param id
     * @return
     */
    Department getDepartmentById(String id);

    /**
     * 根据id修改部门
     * @param department
     */
    void updateDepartment(Department department);

    /**
     * 添加部门
     * @param department
     */
    void insertDepartment(Department department);

    /**
     * 根据id删除
     * @param id
     */
    void deleteDepartmentById(String id);

}
